package com.tudouji.project.d3.domain;

import java.math.BigDecimal;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.tudouji.framework.aspectj.lang.annotation.Excel;
import com.tudouji.framework.web.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * D3平台订单对象 d3_order
 * 
 * @author tudouji
 * @date 2023-03-29
 */
@Data
public class D3Order extends BaseEntity
{
    /**
     * {"content": {
     *     "flag": "NONE",
     *     "discountFee": 20,
     *     "totalPrice": 479.2,
     *     "refType": "DY",
     *     "refundStatus": "NO_REFUND",
     *     "logisticsOrderNo": "",
     *     "latestDeliveryTime": 1679578117000,
     *     "type": "SALE",
     *     "receivedPayment": 0,
     *     "receiverCity": "云浮市",
     *     "orderTime": 1679405317000,
     *     "modifyTime": 1679405328000,
     *     "receiverId": "e86865efd100e7e0fabd5c50838371af",
     *     "receiverCountry": "中国",
     *     "receiverDistrict": "新兴县",
     *     "payment": 459.2,
     *     "lines": [{
     *         "totalPrice": 479.2,
     *         "num": 8,
     *         "refSkuId": "1758697107189773",
     *         "refOlId": "5047904184145264484",
     *         "refundStatus": "NO_REFUND",
     *         "sellPrice": 57.4,
     *         "title": "【银银专属】鲜味结界高纤土豆泥营养代餐0蔗糖低脂多口味3盒/5盒送赠品",
     *         "refSpuId": "3601809994363863117",
     *         "standards": "紫薯玉米、葱香、原味:原味1盒+葱香味1盒+紫薯玉米1盒（送勺子1只）;",
     *         "picUrl": "https://p3-aio.ecombdimg.com/obj/ecom-shop-material/xxLJLqu_m_22088f3c953a4fffa4d030b1c375b69e_sx_271035_www800-800",
     *         "totalSellPrice": 459.2,
     *         "singleFee": 57.4,
     *         "totalFee": 459.2,
     *         "price": 59.9,
     *         "outerId": "3598827098757845703",
     *         "status": "CANCEL"
     *     }],
     *     "receiverTown": "新城镇",
     *     "serviceFee": 0,
     *     "openBuyerId": "",
     *     "mark2": [],
     *     "postFee": 0,
     *     "props": {
     *         "authorName": "银银爱健身❤️",
     *         "authorId": "1103555571230903"
     *     },
     *     "refOid": "5047904184145264484",
     *     "totalSellPrice": 459.2,
     *     "totalFee": 459.2,
     *     "createTime": 1680077164000,
     *     "posCode": "1",
     *     "receiverState": "广东省",
     *     "sellerMemo": "",
     *     "businessType": "GUARANTEE",
     *     "status": "CANCEL",
     *     "buyerMemo": ""
     * }}
     */
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private Long id;

    /** 下单时间 */
    @Excel(name = "下单时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private String orderTime;

    /** 发货时间 */
    @Excel(name = "发货时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private String shippingTime;
    private String shippingTimeSync;

    /** 平台类型 */
    @Excel(name = "渠道", readConverterExp = "DY=抖音, pdd=拼多多,jd=京东, tb=淘宝")
    private String refType;

    /** 订单id */
    @Excel(name = "订单编号")
    private String refOid;

    @Excel(name = "商品名称",width = 32)
    private String title;

    @Excel(name = "商品规格")
    private String standards;

    @Excel(name = "商品数量/盒")
    private BigDecimal num;

    @Excel(name = "结算单价(元)")
    private BigDecimal singleFee;

    @Excel(name = "结算金额(元)")
    private BigDecimal totalFee;

    /** 服务费 */
//    @Excel(name = "平台支付金额")
    private BigDecimal serviceFee;

    /** 快递费用；包邮则是0 */
//    @Excel(name = "平台运费/赠品")
    private BigDecimal postFee;

    /** 买家昵称(淘宝平台返回) */
//    @Excel(name = "收货人")
    private String openBuyerNick;

    @Excel(name = "地址",width = 32)
    private String address;

    /** 收件人国家 */
//    @Excel(name = "收件人国家")
    private String receiverCountry;

    /** 收件人省 */
//    @Excel(name = "收件人省")
    private String receiverState;

    /** 收件人市 */
//    @Excel(name = "收件人市")
    private String receiverCity;

    /** 收件人区/县 */
//    @Excel(name = "收件人区/县")
    private String receiverDistrict;

    /** 收件人镇 */
//    @Excel(name = "收件人镇")
    private String receiverTown;

    /** 物流单号 */
//    @Excel(name = "物流单号")
    private String logisticsOrderNo;
    private String logisticsSendFrom;

    @Excel(name = "ERP订单编号")
    private String sfCode;

    /** 卖家备注 */
    @Excel(name = "备注")
    private String sellerMemo;



//    @Excel(name = "店铺")
    private String posName;

    /** 店铺编码 */
    private String posCode;

    /** 旗帜 */
    private String flag;

    /** 买家留言 */
//    @Excel(name = "买家留言")
    private String buyerMemo;

    /** 订单状态：（DELETED-已删除,CLOSE-已关闭,CANCEL-已取消,UNKNOWN-未知,UNPAID-未付款),PART_PAID-部分付款,NOT_SHIPPED-未发货,PART_SHIPPED-部分发货,SHIPPED-已发货),REJECTED-已拒收,BILL_SHIPPED-已寄票,BILL_COMPLETE-已收票,PAUSE-暂停,LOCKED-锁定,COMPLETE-已完成） */
//    @Excel(name = "订单状态：", readConverterExp = "D=ELETED-已删除,CLOSE-已关闭,CANCEL-已取消,UNKNOWN-未知,UNPAID-未付款),PART_PAID-部分付款,NOT_SHIPPED-未发货,PART_SHIPPED-部分发货,SHIPPED-已发货),REJECTED-已拒收,BILL_SHIPPED-已寄票,BILL_COMPLETE-已收票,PAUSE-暂停,LOCKED-锁定,COMPLETE-已完成")
    private String status;
    private String[] stats;

    /** 订单售后状态：（NONE-未知,NO_REFUND-无退款,PART_REFUNDED-部分退款,ALL_REFUNDED-全部退款） */
//    @Excel(name = "订单售后状态：", readConverterExp = "N=ONE-未知,NO_REFUND-无退款,PART_REFUNDED-部分退款,ALL_REFUNDED-全部退款")
    private String refundStatus;

    /** 实付金额 */
//    @Excel(name = "实付金额")
    private BigDecimal payment;

    /** 实收金额 */
//    @Excel(name = "实收金额")
    private BigDecimal receivedPayment;

    /** 原价合计 */
//    @Excel(name = "原价合计")
    private BigDecimal totalPrice;

    /** 售价合计 */
//    @Excel(name = "售价合计")
    private BigDecimal totalSellPrice;

    /** 优惠金额 */
//    @Excel(name = "优惠金额")
    private BigDecimal discountFee;


    /** 修改时间 */
//    @Excel(name = "修改时间")
    private String modifyTime;

    /** 支付时间 */
//    @Excel(name = "支付时间")
    private String payTime;

    /** 完成时间 */
//    @Excel(name = "完成时间")
    private String finishTime;

    /** 卖家昵称(淘宝平台返回) */
//    @Excel(name = "卖家昵称")
    private String openSellerNick;

    /** 收货人id, 用于判断是否为同一个收货人 */
//    @Excel(name = "收货人id, 用于判断是否为同一个收货人")
    private String receiverId;

    /** 买家OpenUid */
//    @Excel(name = "买家OpenUid")
    private String buyerOpenUid;

    /** 销售订单ID */
    private Long sfId;


    private List<D3OrderItem> lines;

    private Long d3OrderId;
    private String refOlId;
    private String refSpuId;
    private String refSkuId;
    private String outerId;


    private BigDecimal price;
    private BigDecimal sellPrice;

    private String picUrl;

    @JsonIgnore
    private String startdate;
    @JsonIgnore
    private String enddate;

    private Integer isToSellform;//1:已生成中间表0：未生成2:不生成中间表

    /**店铺编码*/
    private String code;

    /**完成时间查询开始*/
    private String finishTimeStart;
    /**完成时间查询结束*/
    private String finishTimeEnd;

}
